Hi,I am trying to search documents in livelink with the help of LAPI in java but it is giving this errorcom.opentext.api.LLIllegalOperationException: get(name) not implemented for this datatype The code is as follows<%@ page language="java" import="java.util.*,javax.servlet.*,javax.servlet.jsp.*,java.sql.*,java.io.*,com.microsoft.jdbc.sqlserver.* "%><%@ page import="com.opentext.api.*" %><%!String dbConnect ; String dbUser ; String dbUPwd ; //Getting the Protocol variableString prefixURL ;LLSession llsession ;String userData ;int startingDirectory;public String showFileType(String fileType){ String imageData[]={"../images/appexel.gif","../images/appword.gif","../images/appppoin.gif","../images/apppdf.gif","../images/doc.gif"}; String showImage = ""; if(fileType.equals("xls")) { showImage = imageData[0]; } else if(fileType.equals("doc")) { showImage = imageData[1]; } else if(fileType.equals("ppt")) { showImage = imageData[2]; } else if(fileType.equals("pdf")) { showImage = imageData[3]; } else { showImage = imageData[4]; } return showImage;}public String ifNull(String x){ if(x==null) { return ""; } else { return x; }}public Hashtable getNames(int userId,JspWriter out) throws IOException{ String fullName = ""; String lastName = ""; Connection conn = null; PreparedStatement ps = null; ResultSet rs = null; Hashtable nameBunch = new Hashtable(); try { DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver()); conn = DriverManager.getConnection(dbConnect,dbUser,dbUPwd); ps = conn.prepareStatement("select firstname, middleName,lastname from kuaf where id=?"); System.out.println("userId="+userId); ps.setInt(1,userId); rs = ps.executeQuery(); while (rs.next()) { fullName = rs.getString("firstname") + " " + ifNull(rs.getString("middleName")) + " " + rs.getString("lastname"); lastName = rs.getString("lastname"); } System.out.println("fullName="+fullName); System.out.println("lastName="+lastName); nameBunch.put("FullName",fullName); nameBunch.put("LastName",lastName); rs.close(); conn.close(); } catch(Exception ex) { out.println(ex.toString()); } finally { try { if(rs!=null) { rs.close(); } if(conn!=null) { conn.close(); } } catch(Exception ex) { } } return (nameBunch);}public int getDataID(String queryName,JspWriter out) throws IOException{ int dataID = -1; Connection conn = null; PreparedStatement ps = null; ResultSet rs = null; try { DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver()); conn = DriverManager.getConnection(dbConnect,dbUser,dbUPwd); ps = conn.prepareStatement("select dataId from dtree where name = ?"); ps.setString(1,queryName); rs = ps.executeQuery(); while (rs.next()) { dataID = rs.getInt("dataId"); } rs.close(); conn.close(); } catch(Exception ex) { out.println(ex.toString()); } finally { try { if(rs!=null) { rs.close(); } if(conn!=null) { conn.close(); } } catch(Exception ex) { } } //depth value is with respect to Top most parentId that is -1 //with respect to Enterprise Workspace 's parent return (dataID); }public String getFileType(String fileName){ StringTokenizer stName = new StringTokenizer(fileName,"."); String fileExtend = ""; while(stName.hasMoreTokens()) { fileExtend = stName.nextToken(); } return (fileExtend);}public String getModifiedDate(int Id,JspWriter out) throws IOException{ String date = ""; Connection conn = null; PreparedStatement ps = null; ResultSet rs = null; try { DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver()); conn = DriverManager.getConnection(dbConnect,dbUser,dbUPwd); //PreparedStatement ps = conn.prepareStatement("select modifydate from dtree where dataid = ?"); ps = conn.prepareStatement("select to_char(modifydate,'dd-mm-yyyy hh24:mi:ss') modifydate from dtree where dataid = ?"); ps.setInt(1,Id); rs = ps.executeQuery(); while (rs.next()) { date=rs.getString("modifyDate"); } rs.close(); conn.close(); } catch(Exception ex) { out.println(ex.toString()); } finally { try { if(rs!=null) { rs.close(); } if(conn!=null) { conn.close(); } } catch(Exception ex) { } } return (date);}%><%//System.out.println("prefixURL");//userData = (String)session.getAttribute("NTUser");//String imageData[]={"../images/appexel.com","../images/appword.com","../images/appppoin.com"};/***************Please Remove The Comments while Integration ****************///Getting Database Variables//dbConnect = (String)session.getAttribute("DBConnectString");//dbUser = (String)session.getAttribute("DBUserName");//dbUPwd = (String)session.getAttribute("DBUserPwd");/*******modifed on 7-sept**********/dbConnect = "jdbc:microsoft:sqlserver://ggnh053a:1433"; dbUser = "livelinkuser";dbUPwd = "livelinkpass";/*******modifed on 7-sept**********///Getting the Protocol variable//prefixURL = (String)session.getAttribute("documentRoot");prefixURL = "
http://ggnh053a:90/";//Livelink session//llsession = (LLSession)session.getAttribute("LivelinkSession");/*** create the llsession 7-sept **/ LLSession llsession = null; LAPI_DOCUMENTS documents = null; int status = 0; int nodeID = 0; int parentID = 0; int nodeVol = 0; int parentVol = 0; LLValue pwsInfo = ( new LLValue() ).setAssocNotSet(); LLValue objInfo = ( new LLValue() ).setAssocNotSet(); LLValue versionInfo = ( new LLValue() ).setAssocNotSet(); // Instantiate session object String server = "ggnh053a"; int port = 2099; String Livelink_ID = "ADMIN"; String UID_PW = "livelink"; llsession = new LLSession( server, port, "", Livelink_ID, UID_PW, null ); /*** create the llsession end here 7-sept **//***************Please Remove The Comments while Integration *****************/%>var widthMax;var heightMax;var xCoor;var yCoor;var sWidth;var sHeight;var xScroll;var widthScroll;var menu = new Array;var divId = new Array;function out(){ var itemId = event.srcElement; itemId = checkElement(itemId); itemId.style.backgroundColor = outBgCr; itemId.style.color = outCr;}function goToLink(){ var itemId = event.srcElement; var baseObj = document.all.tags("BASE"); baseObj.target = itemId.target; var vfdbURL = ""; if(itemId.id == "itemFile1") { vfdbURL = "../../Livelink/llview.exe/" + onClickFileName + ".html?func=doc.View&nodeId=" + onClickFileId + "&docTitle=" + onClickFileName ; itemId.url = vfdbURL; window.open(itemId.url); } else if(itemId.id == "itemFile2") { vfdbURL = "../../Livelink/livelink.exe/" + onClickFileId + "/" + onClickFileName + "." + onClickFileExtension + "?func=doc.Fetch&nodeid="+onClickFileId ; itemId.url = vfdbURL; window.open(itemId.url); } else if(itemId.id == "itemFile3") { vfdbURL = "../../Livelink/livelink.exe?func=ll&objId=" + onClickFileId + "&objAction=download"; itemId.url = vfdbURL; window.open(itemId.url); } }var overBgCr = "#3333CC";var overCr = "#FFFFFF";var outBgCr = "#C0C0C0";var outCr = "#000000";var itemFont = "Arial";function openURL(str){ window.open(str);}var clickedOn;var onClickFileId;var onClickFileName;var onClickFileExtension;function openWindow(fileId,fileName,fileExtension){ onClickFileId = fileId; onClickFileName = fileName; onClickFileExtension = fileExtension; clickedOn = "File"; createPopUpMenu(fileId,fileName,fileExtension);}Documents<%Vector nameFolder = new Vector();Vector idFolder = new Vector();Vector folderTypeFolder = new Vector();Vector folderModifiedDateFolder = new Vector();Vector folderSizeFolder = new Vector();Vector nameFile = new Vector();Vector idFile = new Vector();Vector fileNameFile = new Vector();Vector fileTypeFile = new Vector();Vector fileExtensionFile = new Vector();Vector fileModifiedDateFile = new Vector();Vector fileSizeFile = new Vector();Vector fileSummaryFile = new Vector();Vector fileCreatedByFile = new Vector();Vector scores = new Vector();String DepartmentSelected = "";String comboBuild = "";String keyword = "";try { // Error is given in doc.AccessEnterpriseWS(llvalue) if wrong user information is passed not in llsession //keyword = request.getParameter("Keyword"); keyword = "test"; String query = "( [ region \"OTData\" ] \"" + keyword + "\" ) " + " OR " + "( [ region \"OTName\" ] \"" + keyword + "\" ) " + " OR " + "( [ region \"OTFileName\" ] \"" + keyword + "\" ) " + " OR " + "( [ region \"OTSummary\" ] \"" + keyword + "\" ) " + " OR " + "( [ region \"OTDoc\" ] \"" + keyword + "\" ) "; out.println("query "+ query); LLValue listBrokers = new LLValue(); LLValue selectList = (new LLValue()).setList(); //LLValue selectList = (new LLValue()).setRecord(); LLValue queryResults = (new LLValue()).setAssocNotSet(); //LLValue queryResults = (new LLValue()).setAssoc(); String presentationQuery = "EnterpriseWorkspace"; int objectID = getDataID(presentationQuery,out); LAPI_SEARCH search = new LAPI_SEARCH(llsession); selectList.add( "OTObject" ); selectList.add( "OTData" ); selectList.add( "OTDataID" ); selectList.add( "OTName" ); selectList.add( "OTFileName" ); selectList.add( "OTDataSize" ); selectList.add( "OTModifyDate" ); selectList.add( "OTSummary" ); selectList.add( "OTCreatedBy" ); out.println(selectList.size()); int test = search.ApplyQuery(2000, selectList, query, 0, "", 0, 100, "None", queryResults); out.println("test " + test); /********OverWriting The File Vector In case of Search************/ nameFile = new Vector(); idFile = new Vector(); fileNameFile = new Vector(); fileTypeFile = new Vector(); fileExtensionFile = new Vector(); fileModifiedDateFile = new Vector(); fileSizeFile = new Vector(); fileSummaryFile = new Vector(); fileCreatedByFile = new Vector(); scores = new Vector(); LLValue llvalue1 = new LLValue(); //out.println(llvalue1.size()); //queryResults.setAssoc(); int numDocs = 0; for(int i = 0; i < 2; i++) { if(! (((queryResults.toValue(i)).toString("OTDataSize")).trim()).equals(""))//Only Files { scores.addElement((queryResults.toValue(i)).toString("Score")); idFile.addElement((queryResults.toValue(i)).toString("OTDataID")); nameFile.addElement((queryResults.toValue(i)).toString("OTName")); fileNameFile.addElement((queryResults.toValue(i)).toString("OTFileName")); fileSizeFile.addElement((queryResults.toValue(i)).toString("OTDataSize")); fileSummaryFile.addElement((queryResults.toValue(i)).toString("OTSummary")); fileCreatedByFile.addElement((queryResults.toValue(i)).toString("OTCreatedBy")); fileModifiedDateFile.addElement(getModifiedDate( Integer.parseInt((queryResults.toValue(i)).toString("OTDataID")), out) ); fileTypeFile.addElement(showFileType(getFileType((queryResults.toValue(i)).toString("OTFileName")))); fileExtensionFile.addElement(getFileType((queryResults.toValue(i)).toString("OTFileName"))); numDocs = numDocs + 1; } } out.println("<font face=Arial size=2 color=blue>Number of Outcomes " + numDocs +"
"); //out.println("
Number of Total Outcomes " + queryResults.size() +"
"); }catch (Exception ex){ out.println(ex);}%>
Score | Type | Name | Functions | Size | Modified | Created By |
<% String fileEvenDisplay = ""; String fileOddDisplay = ""; for(int i=0;i<idFile.size();i++) { Hashtable htNames = getNames(Integer.parseInt((fileCreatedByFile.elementAt(i)).toString()) , out); System.out.println("(fileCreatedByFile.elementAt(i)).toString()="+(fileCreatedByFile.elementAt(i)).toString()); String fullName = (String)htNames.get("FullName"); String lastName = (String)htNames.get("LastName"); System.out.println("fullName="+fullName); System.out.println("lastName="+lastName); if(i%2==0) { fileEvenDisplay = "<TR STYLE='background:#FFFFCC;'> " + "" + ((String)(scores.elementAt(i))) + "%" + "" + " " + ((String)nameFile.elementAt(i)) + " (" + ((String)fileNameFile.elementAt(i)) + ")" + " " + "" + "" + Integer.parseInt(((String)fileSizeFile.elementAt(i)))/1000 +" kb " + "" + (fileModifiedDateFile.elementAt(i)).toString() +"" + "" + fullName +"" + "" + " " + "" + "Summary" + " | " + "" + (fileSummaryFile.elementAt(i)).toString() + " | " + "
"; out.println(fileEvenDisplay); } else if(i%2 != 0) { fileOddDisplay = " " + "" + ((String)(scores.elementAt(i))) + "% | " + " (fileTypeFile.elementAt(i))) + ") | " + " " + ((String)nameFile.elementAt(i)) + " (" + ((String)fileNameFile.elementAt(i)) + ") | " + " " + " | " + "" + Integer.parseInt(((String)fileSizeFile.elementAt(i)))/1000 +" kb | " + "" + (fileModifiedDateFile.elementAt(i)).toString() +" | " + "" + fullName +" | " + "
" + " " + "" + "Summary" + " | " + "" + (fileSummaryFile.elementAt(i)).toString() + " | " + "
"; out.println(fileOddDisplay); } } %>